const promisic = function(func) {
    return function(params = {}) {
        new Promise((resolve, reject) => {
          const args = Object.assign(params, {
            success: res => resolve(res),
            fail: error => reject(error)
          });
          func(args);   
        });
    }
}